/**
 *
 * by littlefean
 */

window.onload = function () {

    let comp1 = new ComputeEle(document.querySelector(`.andComp`));
    let comp2 = new ComputeEle(document.querySelector(`.orComp`));
    let comp3 = new ComputeEle(document.querySelector(`.notComp`));
    let comp4 = new ComputeEleRev(document.querySelector(`.revComp`));
    let comp5 = new ComputeEle(document.querySelector(`.leftComp`));
    let comp6 = new ComputeEle(document.querySelector(`.rightComp`));
    let comp7 = new ComputeEle(document.querySelector(`.rightNComp`));
    //
    document.querySelector(`.start`).addEventListener("click", () => {
        comp1.run();
        comp2.run();
        comp3.run();
        comp4.run();
        comp5.run();
        comp6.run();
        comp7.run();
    });

    new BinaryOperationTable(
        "&",
        10,
        document.querySelector(`.andOperation`),
        "按位与运算",
        30,
    ).init();

    new BinaryOperationTable(
        "|",
        10,
        document.querySelector(`.orOperation`),
        "按位或运算",
        30,
    ).init();

    new BinaryOperationTable(
        "^",
        10,
        document.querySelector(`.reverseOperation`),
        "按位取反运算",
        30,
    ).init();

    new BinaryOperationTable(
        "&",
        20,
        document.querySelector(`.reverseOperation`),
        "按位与运算",
        18,
    ).init();

    new BinaryOperationTable(
        "|",
        20,
        document.querySelector(`.reverseOperation`),
        "按位或运算",
        18,
    ).init();

    new BinaryOperationTable(
        "^",
        20,
        document.querySelector(`.reverseOperation`),
        "按位取反运算",
        18,
    ).init();
}
